<?php
//设置站点APP
require('inc/base/app.ini.php');
$DEFAULT_SITE=$config['APP']['DEFAULT_SITE'];
$list_files=glob('inc/site/*/config.php');
if(!empty($list_files)){
    foreach ($list_files as  $key => $value) {
        $site_config=require ($value);
        $site_domain_array=explode(',', $site_config['SITE_DOMAIN']);
        if(in_array($_SERVER['HTTP_HOST'], (array)$site_domain_array)){
        	$file_name=explode('/', $value);
            $file_name=array_slice($file_name,-2,1);
        	$DEFAULT_SITE=$file_name[0];
        }
    }
}
defined('DEFAULT_SITE') or define('DEFAULT_SITE', $DEFAULT_SITE);
//CPAPP
define('DEFAULT_APP', 'default');
require( 'protected/core.php' );
